class SelfVue {
    constructor(options) {
        var _this = this;
        this.data = options.data;
        this.methods = options.methods;

        Object.keys(this.data).forEach(function (key) {
            _this.proxyKeys(key);
        });

        observe(this.data);
        new Compile(options.el, this);
        options.mounted.call(this); // 所有事情处理好后执行mounted函数
    }

    proxyKeys (key) {
        var _this = this;
        Object.defineProperty(this, key, {
            enumerable: false,
            configurable: true,
            get: function getter() {
                return _this.data[key];
            },
            set: function setter(newVal) {
                _this.data[key] = newVal;
            }
        });
    }
}